home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3c / strtol.z / strtol
Encoding:
Text File  |  1998-10-20  |  9.8 KB  |  133 lines

  1.  
  2.  
  3.  
  4. ssssttttrrrrttttoooollll((((3333CCCC))))                                                          ssssttttrrrrttttoooollll((((3333CCCC))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _ssss_tttt_rrrr_tttt_oooo_llll, _ssss_tttt_rrrr_tttt_oooo_uuuu_llll, _aaaa_tttt_oooo_llll, _aaaa_tttt_oooo_iiii, _ssss_tttt_rrrr_tttt_oooo_llll_llll, _ssss_tttt_rrrr_tttt_oooo_uuuu_llll_llll, _aaaa_tttt_oooo_llll_llll - convert string to
  10.      integer
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_tttt_dddd_llll_iiii_bbbb_...._hhhh_>>>>
  14.  
  15.      _llll_oooo_nnnn_gggg _ssss_tttt_rrrr_tttt_oooo_llll _((((_cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_ssss_tttt_rrrr_,,,, _cccc_hhhh_aaaa_rrrr _****_****_pppp_tttt_rrrr_,,,, _iiii_nnnn_tttt _bbbb_aaaa_ssss_eeee_))))_;;;;
  16.  
  17.      _uuuu_nnnn_ssss_iiii_gggg_nnnn_eeee_dddd _llll_oooo_nnnn_gggg _ssss_tttt_rrrr_tttt_oooo_uuuu_llll _((((_cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_ssss_tttt_rrrr_,,,, _cccc_hhhh_aaaa_rrrr _****_****_pppp_tttt_rrrr_,,,, _iiii_nnnn_tttt _bbbb_aaaa_ssss_eeee_))))_;;;;
  18.  
  19.      _llll_oooo_nnnn_gggg _llll_oooo_nnnn_gggg _ssss_tttt_rrrr_tttt_oooo_llll_llll _((((_cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_ssss_tttt_rrrr_,,,, _cccc_hhhh_aaaa_rrrr _****_****_pppp_tttt_rrrr_,,,, _iiii_nnnn_tttt _bbbb_aaaa_ssss_eeee_))))_;;;;
  20.  
  21.      _uuuu_nnnn_ssss_iiii_gggg_nnnn_eeee_dddd _llll_oooo_nnnn_gggg _llll_oooo_nnnn_gggg _ssss_tttt_rrrr_tttt_oooo_uuuu_llll_llll _((((_cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_ssss_tttt_rrrr_,,,, _cccc_hhhh_aaaa_rrrr _****_****_pppp_tttt_rrrr_,,,, _iiii_nnnn_tttt _bbbb_aaaa_ssss_eeee_))))_;;;;
  22.  
  23.      _iiii_nnnn_tttt _aaaa_tttt_oooo_iiii _((((_cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_ssss_tttt_rrrr_))))_;;;;
  24.  
  25.      _llll_oooo_nnnn_gggg _aaaa_tttt_oooo_llll _((((_cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_ssss_tttt_rrrr_))))_;;;;
  26.  
  27.      _llll_oooo_nnnn_gggg _llll_oooo_nnnn_gggg _aaaa_tttt_oooo_llll_llll _((((_cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_ssss_tttt_rrrr_))))_;;;;
  28.  
  29. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  30.      _ssss_tttt_rrrr_tttt_oooo_llll returns as a long integer the value represented by the character
  31.      string pointed to by _ssss_tttt_rrrr.  The string is scanned up to the first
  32.      character inconsistent with the base.  Leading ``white-space'' characters
  33.      [as defined by _iiii_ssss_ssss_pppp_aaaa_cccc_eeee in _cccc_tttt_yyyy_pppp_eeee(3C)] are ignored.
  34.  
  35.      If the value of _p_t_r is not _((((_cccc_hhhh_aaaa_rrrr _****_****_))))_NNNN_UUUU_LLLL_LLLL, a pointer to the character
  36.      terminating the scan is returned in the location pointed to by _p_t_r.  If
  37.      no integer can be formed, that location is set to _ssss_tttt_rrrr, and zero is
  38.      returned.
  39.  
  40.      If _b_a_s_e is between 2 and 36, inclusive, it is used as the base for
  41.      conversion.  After an optional leading sign, leading zeros are ignored,
  42.      and ``_0000_xxxx'' or ``_0000_XXXX'' is ignored if _b_a_s_e is 16.
  43.  
  44.      If _b_a_s_e is zero, the string itself determines the base as follows: After
  45.      an optional leading sign a leading zero indicates octal conversion, and a
  46.      leading ``_0000_xxxx'' or ``_0000_XXXX'' hexadecimal conversion.  Otherwise, decimal
  47.      conversion is used.
  48.  
  49.      Truncation from _llll_oooo_nnnn_gggg to _iiii_nnnn_tttt can, of course, take place upon assignment or
  50.      by an explicit cast.
  51.  
  52.      If the value represented by _s_t_r would cause overflow, _LLLL_OOOO_NNNN_GGGG______MMMM_AAAA_XXXX or
  53.      _LLLL_OOOO_NNNN_GGGG______MMMM_IIII_NNNN is returned (according to the sign of the value), and _eeee_rrrr_rrrr_nnnn_oooo is
  54.      set to the value, _EEEE_RRRR_AAAA_NNNN_GGGG_EEEE.
  55.  
  56.      _ssss_tttt_rrrr_tttt_oooo_uuuu_llll is similar to _ssss_tttt_rrrr_tttt_oooo_llll except that _ssss_tttt_rrrr_tttt_oooo_uuuu_llll returns as an unsigned
  57.      long integer the value represented by _s_t_r.  If the value represented by
  58.      _s_t_r would cause overflow, _UUUU_LLLL_OOOO_NNNN_GGGG______MMMM_AAAA_XXXX is returned, and _eeee_rrrr_rrrr_nnnn_oooo is set to the
  59.      value, _EEEE_RRRR_AAAA_NNNN_GGGG_EEEE.
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ssssttttrrrrttttoooollll((((3333CCCC))))                                                          ssssttttrrrrttttoooollll((((3333CCCC))))
  71.  
  72.  
  73.  
  74.      _ssss_tttt_rrrr_tttt_oooo_llll_llll is similar to _ssss_tttt_rrrr_tttt_oooo_llll except that _ssss_tttt_rrrr_tttt_oooo_llll_llll returns as a long long
  75.      integer the value represented by _s_t_r.  If the value represented by _s_t_r
  76.      would cause overflow, _LLLL_OOOO_NNNN_GGGG_LLLL_OOOO_NNNN_GGGG______MMMM_AAAA_XXXX or _LLLL_OOOO_NNNN_GGGG_LLLL_OOOO_NNNN_GGGG______MMMM_IIII_NNNN is returned (according
  77.      to the sign of the value), and _eeee_rrrr_rrrr_nnnn_oooo is set to the value, _EEEE_RRRR_AAAA_NNNN_GGGG_EEEE.
  78.  
  79.      _ssss_tttt_rrrr_tttt_oooo_uuuu_llll_llll is similar to _ssss_tttt_rrrr_tttt_oooo_llll_llll except that _ssss_tttt_rrrr_tttt_oooo_uuuu_llll_llll returns as an
  80.      unsigned long long integer the value represented by _s_t_r.  If the value
  81.      represented by _s_t_r would cause overflow, _UUUU_LLLL_OOOO_NNNN_GGGG_LLLL_OOOO_NNNN_GGGG______MMMM_AAAA_XXXX is returned, and
  82.      _eeee_rrrr_rrrr_nnnn_oooo is set to the value, _EEEE_RRRR_AAAA_NNNN_GGGG_EEEE.
  83.  
  84.      Except for behavior on error, _aaaa_tttt_oooo_llll_((((_ssss_tttt_rrrr_)))) is equivalent to:
  85.           _ssss_tttt_rrrr_tttt_oooo_llll_((((_ssss_tttt_rrrr_,,,, _((((_cccc_hhhh_aaaa_rrrr _****_****_))))_NNNN_UUUU_LLLL_LLLL_,,,, _1111_0000_))))
  86.  
  87.      Except for behavior on error, _aaaa_tttt_oooo_iiii_((((_ssss_tttt_rrrr_)))) is equivalent to:
  88.           _((((_iiii_nnnn_tttt_)))) _ssss_tttt_rrrr_tttt_oooo_llll_((((_ssss_tttt_rrrr_,,,, _((((_cccc_hhhh_aaaa_rrrr _****_****_))))_NNNN_UUUU_LLLL_LLLL_,,,, _1111_0000_))))
  89.  
  90.      Except for behavior on error, _aaaa_tttt_oooo_llll_llll_((((_ssss_tttt_rrrr_)))) is equivalent to:
  91.           _ssss_tttt_rrrr_tttt_oooo_llll_llll_((((_ssss_tttt_rrrr_,,,, _((((_cccc_hhhh_aaaa_rrrr _****_****_))))_NNNN_UUUU_LLLL_LLLL_,,,, _1111_0000_))))
  92.  
  93. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  94.      If _ssss_tttt_rrrr_tttt_oooo_llll is given a _b_a_s_e greater than 36 or less than 2, it returns 0
  95.      and sets _eeee_rrrr_rrrr_nnnn_oooo to _EEEE_IIII_NNNN_VVVV_AAAA_LLLL.
  96.  
  97. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  98.      _cccc_tttt_yyyy_pppp_eeee(3C), _ssss_tttt_rrrr_tttt_oooo_dddd(3C), _ssss_cccc_aaaa_nnnn_ffff(3S).
  99.  
  100. NNNNOOOOTTTTEEEESSSS
  101.      _ssss_tttt_rrrr_tttt_oooo_llll no longer accepts values greater than _LLLL_OOOO_NNNN_GGGG______MMMM_AAAA_XXXX as valid input.
  102.      Use _ssss_tttt_rrrr_tttt_oooo_uuuu_llll instead.
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.